﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using WebApplicationBack;
using System.IO;

namespace UnzipFile
{
    public class Unzip
    {
        public void Run()
        {
            string folder = ConfigurationManager.AppSettings["ZippedFileFolder"];
            string password = ConfigurationManager.AppSettings["Password"];
            FileOperation _op = new FileOperation();

            if (Directory.Exists(folder))
            {
                foreach (string file in Directory.GetFiles(folder))
                {
                    _op.UnZip(file, file.Substring(0, file.LastIndexOf(".")), password);
                }
            }
        }
    }
}
